﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FirstQuestion
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string[] a = textBox1.Text.Split(',','，');
            int[] num = Array.ConvertAll(a, int.Parse);
            int max=0 , min=0, union=0;
            for (int i = 0; i < num.Length; i++)
            {
                if (num[i] < min) min = num[i];
                if (num[i] > max) max = num[i];
                union += num[i];
            }
            double aver = union / num.Length;
            tb_max.Text = max + "";
            tb_min.Text = min + "";
            tb_aver.Text = aver + "";
            tb_union.Text = union.ToString();
        }

        private void tb_max_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
